<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>netaddr.address.Wildcard</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="netaddr-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >netaddr</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="netaddr-module.html">Package&nbsp;netaddr</a> ::
        <a href="netaddr.address-module.html" onclick="show_private();">Module&nbsp;address</a> ::
        Class&nbsp;Wildcard
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="netaddr.address.Wildcard-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Wildcard</h1><p class="nomargin-top"><span class="codelink"><a href="netaddr.address-pysrc.html#Wildcard">source&nbsp;code</a></span></p>
<pre class="base-tree">
object --+    
         |    
   <a href="netaddr.address.IPRange-class.html">IPRange</a> --+
             |
            <strong class="uidshort">Wildcard</strong>
</pre>

<hr />
<p>Represents blocks of IPv4 addresses using a wildcard or glob style 
  syntax.</p>
  <p>Individual octets can be represented using the following shortcuts 
  :</p>
  <ol start="1">
    <li>
      <code>*</code> - the asterisk octet (represents values 0 through 255)
    </li>
    <li>
      <code>'x-y'</code> - the hyphenated octet (represents values x 
      through y)
    </li>
  </ol>
  <p>A few basic rules also apply :</p>
  <ol start="1">
    <li>
      x must always be greater than y, therefore :
      <ul>
        <li>
          x can only be 0 through 254
        </li>
        <li>
          y can only be 1 through 255
        </li>
      </ul>
    </li>
    <li>
      only one hyphenated octet per wildcard is allowed
    </li>
    <li>
      only asterisks are permitted after a hyphenated octet
    </li>
  </ol>
  <p>Example wildcards :</p>
<pre class="literalblock">
   '192.168.0.1'       #   a single address
   '192.168.0.0-31'    #   32 addresses
   '192.168.0.*'       #   256 addresses
   '192.168.0-1.*'     #   512 addresses
   '192.168-169.*.*'   #   131,072 addresses
   '*.*.*.*'           #   the whole IPv4 address space
</pre>
  <h1 class="heading">Aside</h1>
    <p><i>Wildcard ranges are not directly equivalent to CIDR blocks as 
    they can represent address ranges that do not fall on strict bit mask 
    boundaries. They are very suitable in configuration files being more 
    obvious and readable than their CIDR equivalents, especially for admins
    and users without much networking knowledge or experience.</i></p>
    <p><i>All CIDR blocks can always be represented as wildcard ranges but 
    the reverse is not true. Wildcards are almost but not quite as flexible
    as IPRange objects.</i></p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Methods</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.Wildcard-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">wildcard</span>,
        <span class="summary-sig-arg">fmt</span>=<span class="summary-sig-default">&lt;class 'netaddr.address.IP'&gt;</span>)</span><br />
      Constructor.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#Wildcard.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.Wildcard-class.html#__str__" class="summary-sig-name">__str__</a>(<span class="summary-sig-arg">self</span>)</span><br />
      str(x)</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#Wildcard.__str__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.Wildcard-class.html#__repr__" class="summary-sig-name">__repr__</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      executable Python string to recreate equivalent object.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#Wildcard.__repr__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="netaddr.address.IPRange-class.html">IPRange</a></code></b>:
      <code><a href="netaddr.address.IPRange-class.html#__contains__">__contains__</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#__eq__">__eq__</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#__ge__">__ge__</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#__getitem__">__getitem__</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#__gt__">__gt__</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#__hash__">__hash__</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#__iadd__">__iadd__</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#__isub__">__isub__</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#__iter__">__iter__</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#__le__">__le__</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#__len__">__len__</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#__lt__">__lt__</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#__ne__">__ne__</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#adjacent">adjacent</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#cidrs">cidrs</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#format">format</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#iprange">iprange</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#issubnet">issubnet</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#issupernet">issupernet</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#overlaps">overlaps</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#size">size</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#wildcard">wildcard</a></code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__getattribute__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__setattr__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== STATIC METHODS ==================== -->
<a name="section-StaticMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Static Methods</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.Wildcard-class.html#is_valid" class="summary-sig-name">is_valid</a>(<span class="summary-sig-arg">wildcard</span>)</span><br />
      A static method that validates wildcard address ranges.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#Wildcard.is_valid">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Class Variables</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="STRATEGIES"></a><span class="summary-name">STRATEGIES</span> = <code title="(IPv4StrategyOpt(32, 8, '.', 4, 10, False))"><code class="variable-group">(</code>IPv4StrategyOpt(32, 8, '.', 4, 10, False)<code class="variable-group">)</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="ADDR_TYPES"></a><span class="summary-name">ADDR_TYPES</span> = <code title="(0, 4)"><code class="variable-group">(</code>0<code class="variable-op">, </code>4<code class="variable-group">)</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="strategy"></a><span class="summary-name">strategy</span> = <code title="StrategyDescriptor(STRATEGIES)">StrategyDescriptor(STRATEGIES)</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="addr_type"></a><span class="summary-name">addr_type</span> = <code title="AddrTypeDescriptor(ADDR_TYPES)">AddrTypeDescriptor(ADDR_TYPES)</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="fmt"></a><span class="summary-name">fmt</span> = <code title="FormatDescriptor(IP)">FormatDescriptor(IP)</code>
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="netaddr.address.IPRange-class.html">IPRange</a></code></b>:
      <code><a href="netaddr.address.IPRange-class.html#first">first</a></code>,
      <code><a href="netaddr.address.IPRange-class.html#last">last</a></code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Properties</span></td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="is_valid"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">is_valid</span>(<span class="sig-arg">wildcard</span>)</span>
    <br /><em class="fname">Static Method</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#Wildcard.is_valid">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>A static method that validates wildcard address ranges.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>wildcard</code></strong> - an IPv4 wildcard address.</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>True if wildcard address is valid, False otherwise.</dd>
  </dl>
</td></tr></table>
</div>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">wildcard</span>,
        <span class="sig-arg">fmt</span>=<span class="sig-default">&lt;class 'netaddr.address.IP'&gt;</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#Wildcard.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Constructor.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>wildcard</code></strong> - a valid IPv4 wildcard address</li>
        <li><strong class="pname"><code>fmt</code></strong> - (optional) callable used on return values. Default: <a 
          href="netaddr.address.IP-class.html" class="link">IP</a> objects.
          See <a href="netaddr.address-module.html#nrange" 
          class="link">nrange()</a> documentations for more details on the 
          various options..</li>
    </ul></dd>
    <dt>Overrides:
        object.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="__str__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">self</span>)</span>
    <br /><em class="fname">(Informal representation operator)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#Wildcard.__str__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>str(x)</p>
  <dl class="fields">
    <dt>Overrides:
        object.__str__
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="__repr__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">self</span>)</span>
    <br /><em class="fname">(Representation operator)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#Wildcard.__repr__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>repr(x)</p>
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>executable Python string to recreate equivalent object.</dd>
    <dt>Overrides:
        object.__repr__
    </dt>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="netaddr-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >netaddr</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Wed Jan 21 23:41:06 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
